Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Oct 29, 2025

This change introduces a define option to the dev-server builder, allowing users to specify global constants that will be replaced at build time. This provides a convenient way to configure environment-specific variables directly from the dev-server configuration.

The dev-server define option is merged with any define options present in the underlying build target, with the dev-server's values taking precedence in case of conflicts.

To support testing of this feature, a new modifyTarget method has been added to the builder test harness. This helper simplifies the modification of a target's options within a test case. Comprehensive end-to-end tests have been added to verify the replacement, merging, and override behaviors.

Closes #28905

@clydin clydin added the target: rc This PR is targeted for the next release-candidate label Oct 29, 2025
@clydin clydin force-pushed the dev-server/define-passthrough branch from ff9c806 to cdaa818 Compare October 29, 2025 15:00
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Oct 29, 2025
clydin and others added 2 commits October 29, 2025 15:56
This change introduces a `define` option to the dev-server builder, allowing users to specify global constants that will be replaced at build time. This provides a convenient way to configure environment-specific variables directly from the dev-server configuration.

The dev-server `define` option is merged with any `define` options present in the underlying build target, with the dev-server's values taking precedence in case of conflicts.

To support testing of this feature, a new `modifyTarget` method has been added to the builder test harness. This helper simplifies the modification of a target's options within a test case. Comprehensive end-to-end tests have been added to verify the replacement, merging, and override behaviors.
@alan-agius4 alan-agius4 force-pushed the dev-server/define-passthrough branch from 7a0f6a4 to fd38f01 Compare October 29, 2025 15:56
@clydin clydin merged commit 4211534 into angular:main Oct 29, 2025
31 checks passed
@clydin
Copy link
Member Author

clydin commented Oct 29, 2025

This PR was merged into the repository. The changes were merged into the following branches:

@clydin clydin deleted the dev-server/define-passthrough branch October 29, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ng serve does not support the "define" argument

2 participants